﻿Imports Tohto.Base.DBUtility
Imports Tohto.Base.Entity
Imports Oracle.DataAccess.Client
Imports System.Text

Public Class RP0020B01

    Public Function Fecth_List(ByVal strI_VC_KOJI_NO As String, _
                       ByVal strI_VC_TEHAI_NO As Integer, _
                       ByVal strI_VC_ROW_NO As Integer, _
                       ByRef errinfo As PLSQLErrorInfo) As DataTable

        errinfo.Clear()

        Dim strCmdText As String
        strCmdText = "PG_RP0020.FETCH_LIST"

        Dim parameters(5) As OracleParameter

        Dim I_VC_KOJI_NO As New OracleParameter("I_VC_KOJI_NO", OracleDbType.Varchar2, ParameterDirection.Input)
        I_VC_KOJI_NO.Value = strI_VC_KOJI_NO

        Dim I_VC_TEHAI_NO As New OracleParameter("I_VC_TEHAI_NO", OracleDbType.Varchar2, ParameterDirection.Input)
        I_VC_TEHAI_NO.Value = strI_VC_TEHAI_NO

        Dim I_VC_ROW_NO As New OracleParameter("I_VC_ROW_NO", OracleDbType.Varchar2, ParameterDirection.Input)
        I_VC_ROW_NO.Value = strI_VC_ROW_NO

        Dim O_CU_DATA As New OracleParameter("O_CU_DATA", OracleDbType.RefCursor, ParameterDirection.Output)
        Dim O_CU_ERR As New OracleParameter("O_CU_ERR", OracleDbType.RefCursor, ParameterDirection.Output)
        Dim O_STATS As New OracleParameter("O_STATS", OracleDbType.Int32, ParameterDirection.ReturnValue)

        parameters(0) = I_VC_KOJI_NO
        parameters(1) = I_VC_TEHAI_NO
        parameters(2) = I_VC_ROW_NO
        parameters(3) = O_CU_DATA
        parameters(4) = O_CU_ERR
        parameters(5) = O_STATS

        Dim ds As DataSet = Nothing
        Dim tableNames(0) As String
        tableNames(0) = "O_CU_DATA"

        ds = OracleHelp.FillTable(OracleHelp.ConnectionStringLocalTransaction,
                                           CommandType.StoredProcedure,
                                           strCmdText,
                                           errinfo,
                                           parameters,
                                           tableNames)


        Return ds.Tables("O_CU_DATA")

    End Function



End Class
